package com.kyivmohyla.kma2.model;

import com.google.gwt.user.client.rpc.IsSerializable;

import java.util.Date;

public class Order implements IsSerializable {
    private int orderId;
    private Date createDate;
    private Date startDate;
    private Date endDate;
    private Date desStartDate;
    private Date desEndDate;
    private String commentary;
    private int stateId;
    private int customerId;
    private int engineerId;
    private String stateName;
    private String customerName;
    private String engineerName;
    private String customerAddress;

    public Order() {
    }

    public String getStateName() {
        return stateName;
    }

    public void setStateName(String stateName) {
        this.stateName = stateName;
    }

    public String getCustomerName() {
        return customerName;
    }

    public void setCustomerName(String customerName) {
        this.customerName = customerName;
    }

    public String getEngineerName() {
        return engineerName;
    }

    public void setEngineerName(String engineerName) {
        this.engineerName = engineerName;
    }

    public int getOrderId() {

        return orderId;
    }

    public void setOrderId(int orderId) {
        this.orderId = orderId;
    }

    public Date getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }

    public Date getStartDate() {
        return startDate;
    }

    public void setStartDate(Date startDate) {
        this.startDate = startDate;
    }

    public Date getEndDate() {
        return endDate;
    }

    public void setEndDate(Date endDate) {
        this.endDate = endDate;
    }

    public Date getDesStartDate() {
        return desStartDate;
    }

    public void setDesStartDate(Date desStartDate) {
        this.desStartDate = desStartDate;
    }

    public Date getDesEndDate() {
        return desEndDate;
    }

    public void setDesEndDate(Date desEndDate) {
        this.desEndDate = desEndDate;
    }

    public String getCommentary() {
        return commentary;
    }

    public void setCommentary(String commentary) {
        this.commentary = commentary;
    }

    public int getStateId() {
        return stateId;
    }

    public void setStateId(int stateId) {
        this.stateId = stateId;
    }

    public int getCustomerId() {
        return customerId;
    }

    public void setCustomerId(int customerId) {
        this.customerId = customerId;
    }

    public int getEngineerId() {
        return engineerId;
    }

    public void setEngineerId(int engineerId) {
        this.engineerId = engineerId;
    }

    public String getCustomerAddress() {
        return customerAddress;
    }

    public void setCustomerAddress(String customerAddress) {
        this.customerAddress = customerAddress;
    }

    @Override
    public boolean equals(Object other) {
        return (other instanceof Order) ? orderId == ((Order) other).orderId
                : (other == this);
    }

    @Override
    public int hashCode() {
        return this.getClass().hashCode();
    }

    @Override
    public String toString() {
        return String
                .format("Order(orderId = %s, createDate = %s, startDate = %s, endDate = %s, desStartDate = %s, desEndDate = %s, commentary = %s, stateId = %d, customerId = %d, engineerId = %d)",
                        orderId, createDate, startDate, endDate, desStartDate,
                        desEndDate, commentary, stateId, customerId, engineerId);
    }
}